This is the callback function in which custom study sets up its configuration.
init( );
This callback is called once during study initialization, and is used as a placeholder for setting various settings and parameters for the study.
The following example demonstrates init() callback function.
function init()
{
//setup study's initial settings
this.setName("cSMA");
this.addDataPlot("customSMA");
this.addParameter("Period", 10);
//set to true so that this study can use *any* data source
setAnyDataSource(true);
//moving average requires a minimum of periods to calculate one value
setMinRequiredDataValues(this.getParameter("Period"));
}
Copyright © 2006-2009 ActiveTick LLC